package com.example.domain;

import java.sql.Timestamp;

// OrderRecord.java
public class OrderRecord {
    private int order_id; // 对应数据库中的 order_id
    private String order_no; // 对应数据库中的 order_no
    private String chapter_id; // 对应数据库中的 chapter_id
    private String chapter_title; // 对应数据库中的 chapter_title
    private String novel_name; // 对应数据库中的 novel_name
    private double price; // 对应数据库中的 price
    private String status; // 对应数据库中的 status
    private java.sql.Timestamp create_time; // 对应数据库中的 create_time
    private String user_id; // 对应数据库中的 user_id

    // 构造函数
    public OrderRecord() {
        this.create_time = new Timestamp(System.currentTimeMillis());
        this.status = "PENDING";     // 初始状态为待支付
    }

    public OrderRecord(int order_id, String order_no, String chapter_id, String chapter_title, String novel_name, double price, String status, Timestamp create_time, String user_id) {
        this.order_id = order_id;
        this.order_no = order_no;
        this.chapter_id = chapter_id;
        this.chapter_title = chapter_title;
        this.novel_name = novel_name;
        this.price = price;
        this.status = status;
        this.create_time = create_time;
        this.user_id = user_id;
    }

    /**
     * 获取
     * @return order_id
     */
    public int getOrder_id() {
        return order_id;
    }

    /**
     * 设置
     * @param order_id
     */
    public void setOrder_id(int order_id) {
        this.order_id = order_id;
    }

    /**
     * 获取
     * @return order_no
     */
    public String getOrder_no() {
        return order_no;
    }

    /**
     * 设置
     * @param order_no
     */
    public void setOrder_no(String order_no) {
        this.order_no = order_no;
    }

    /**
     * 获取
     * @return chapter_id
     */
    public String getChapter_id() {
        return chapter_id;
    }

    /**
     * 设置
     * @param chapter_id
     */
    public void setChapter_id(String chapter_id) {
        this.chapter_id = chapter_id;
    }

    /**
     * 获取
     * @return chapter_title
     */
    public String getChapter_title() {
        return chapter_title;
    }

    /**
     * 设置
     * @param chapter_title
     */
    public void setChapter_title(String chapter_title) {
        this.chapter_title = chapter_title;
    }

    /**
     * 获取
     * @return novel_name
     */
    public String getNovel_name() {
        return novel_name;
    }

    /**
     * 设置
     * @param novel_name
     */
    public void setNovel_name(String novel_name) {
        this.novel_name = novel_name;
    }

    /**
     * 获取
     * @return price
     */
    public double getPrice() {
        return price;
    }

    /**
     * 设置
     * @param price
     */
    public void setPrice(double price) {
        this.price = price;
    }

    /**
     * 获取
     * @return status
     */
    public String getStatus() {
        return status;
    }

    /**
     * 设置
     * @param status
     */
    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * 获取
     * @return create_time
     */
    public Timestamp getCreate_time() {
        return create_time;
    }

    /**
     * 设置
     * @param create_time
     */
    public void setCreate_time(Timestamp create_time) {
        this.create_time = create_time;
    }

    /**
     * 获取
     * @return user_id
     */
    public String getUser_id() {
        return user_id;
    }

    /**
     * 设置
     * @param user_id
     */
    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String toString() {
        return "OrderRecord{order_id = " + order_id + ", order_no = " + order_no + ", chapter_id = " + chapter_id + ", chapter_title = " + chapter_title + ", novel_name = " + novel_name + ", price = " + price + ", status = " + status + ", create_time = " + create_time + ", user_id = " + user_id + "}";
    }
}